UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JxqFPAiiXT/yNuTiIfc5OZJzz86hryot7zZOWkefgE4=' 
WHERE 
  key_id = '0e6f9f9ee7127ced59ae3db1a745e42adfb7b316a1bb63feefa2436a58f73ce3' 
  AND (
    token = 'JxqFPAiiXT/yNuTiIfc5OZJzz86hryot7zZOWkefgE4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025