UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'J+QX020tdretusDRT4HoFa5YGd5BAxXLl7PtNNTslQM=' 
WHERE 
  key_id = '02b41040d32527fb97bd44be11a8a1e3af403330c11de19b05926dc8de0bd1f3' 
  AND (
    token = 'J+QX020tdretusDRT4HoFa5YGd5BAxXLl7PtNNTslQM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047