UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UeAv3RvLvE4AeQlo9beP9WIZazsptrd6BRym3pRb99I=' 
WHERE 
  key_id = '47061fbbe5b0720b8c18a1e7e752716dd7894ccf5e9de946aeeff1adafef41e3' 
  AND (
    token = 'UeAv3RvLvE4AeQlo9beP9WIZazsptrd6BRym3pRb99I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035