UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+rnPRi53MDS25DjbdfgUz35dPqe8cpyIUv7sEQ1x2Ww=' 
WHERE 
  key_id = '072e0e2f12d5ddd8f99d79d30e41a5d615b2f3f19001bec9eb924a46706b58fe' 
  AND (
    token = '+rnPRi53MDS25DjbdfgUz35dPqe8cpyIUv7sEQ1x2Ww=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017