UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oGV4AQKvsflBLOxHCWb4sxnrI12Rktvn3oCI0AQjoFk=' 
WHERE 
  key_id = '51532b23cb3ae937e6db20becb4e4d156cbee825fea2ca7e1cb3bb2d88cddb82' 
  AND (
    token = 'oGV4AQKvsflBLOxHCWb4sxnrI12Rktvn3oCI0AQjoFk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035