UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'STpwYzdbxcpf17+ATtdj5ude8TPTeSZ5JZDArwUVfqo=' 
WHERE 
  key_id = '2a798a5df12cfc4eef6b60908ffb356d2758dbd541dff2d0e4f099fa033c0923' 
  AND (
    token = 'STpwYzdbxcpf17+ATtdj5ude8TPTeSZ5JZDArwUVfqo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015