UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xhfCRfbaHXUbMjzsG6jS5aB/rXkw7m2FDVTM/6aZoSg=' 
WHERE 
  key_id = 'ee7d71aba591b02117c5ba63a628fd56de5b8c4ad2d3935a90672f53491ec958' 
  AND (
    token = 'xhfCRfbaHXUbMjzsG6jS5aB/rXkw7m2FDVTM/6aZoSg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015