UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DXKtQg+2LuuWQPAZnjGxxKuG5bTSlv8lIpgzppP1sAQ=' 
WHERE 
  key_id = '74897b5004ab391d8d8bd98a7355812e4c06357c3c956084fa1ef352c1e9abd3' 
  AND (
    token = 'DXKtQg+2LuuWQPAZnjGxxKuG5bTSlv8lIpgzppP1sAQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048