UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kHc5zR/JNOiBhcpqiNTcaSnS8/eGU5v4/7/nZS0PTTI=' 
WHERE 
  key_id = '82e5c98624ce6cf177e5cf3f5b6898e5bbbf9d0f2b1b51a6cc49acb863e31909' 
  AND (
    token = 'kHc5zR/JNOiBhcpqiNTcaSnS8/eGU5v4/7/nZS0PTTI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037