UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PIJPB6fYxiLmvnCt/5Y+oa+TRE597hQEGPccqKiFSqE=' 
WHERE 
  key_id = '57ddd29fe79118b4b7c44ff6d41604be3053253a7a55d7528acc3eac6fb48612' 
  AND (
    token = 'PIJPB6fYxiLmvnCt/5Y+oa+TRE597hQEGPccqKiFSqE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033