UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MpYwbSyf7jxEtVsHrCd9unNpmFu+KSMc414d0ypPrAE=' 
WHERE 
  key_id = '55f507527e260835d03616639322f27ffb8221b53cb1517a366d96f24d8b32ce' 
  AND (
    token = 'MpYwbSyf7jxEtVsHrCd9unNpmFu+KSMc414d0ypPrAE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018