UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Slu0hwaMECKKJdqndHvDYaUYDtZJBVqV5wNI+fDDE4Q=' 
WHERE 
  key_id = '05bb847395bb8a10a694ffea4f8ef2959721e886ace2564cd8453aba390caa1a' 
  AND (
    token = 'Slu0hwaMECKKJdqndHvDYaUYDtZJBVqV5wNI+fDDE4Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024