UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OmyBAw/3UZ6o7OTNCx08rRiIGaJzzQIxNXkF4nOziOI=' 
WHERE 
  key_id = '30f14a6644cce2c8e9bfd562c81cef516a88b3da081ded3d8d819c45d8a5170a' 
  AND (
    token = 'OmyBAw/3UZ6o7OTNCx08rRiIGaJzzQIxNXkF4nOziOI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036