UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6n/Shu8LU7/66JKp5jtTR/f/ENsMiZlIVjPb7I63lFo=' 
WHERE 
  key_id = 'd4aac76068c128ec243c5a85ad8e7034133a0870ee386eaa808573413ad22e3d' 
  AND (
    token = '6n/Shu8LU7/66JKp5jtTR/f/ENsMiZlIVjPb7I63lFo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023