UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'm5p+bzFxkFSrjAvw+TWWy+CNP1w1KI4c8Ptw9lrL1xE=' 
WHERE 
  key_id = 'ef45ec413be6f04dc47f0bcbe13114749ee049534d8429e054c47934efd254df' 
  AND (
    token = 'm5p+bzFxkFSrjAvw+TWWy+CNP1w1KI4c8Ptw9lrL1xE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016