UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wCcgZxLJpQQk0Cc/9ELpTQubBPYfP8yYmwncSPz0Nfk=' 
WHERE 
  key_id = 'c726a6d9cef32e6da263749ca60ad5aa508572628447fb7d166f9899588fab48' 
  AND (
    token = 'wCcgZxLJpQQk0Cc/9ELpTQubBPYfP8yYmwncSPz0Nfk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039