UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9QdjenFDmVC7Z1LeV3vTvCbQh9iUzxngs/IEpiYmQzI=' 
WHERE 
  key_id = 'fc2291527f4442b14605f2abf6efd15ea743519e76c0f2f1a70fd061acad86e6' 
  AND (
    token = '9QdjenFDmVC7Z1LeV3vTvCbQh9iUzxngs/IEpiYmQzI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050