UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Q4x0TObc4N/ohapFBmg6X3OUL8tq75w5eiPc0F7Setc=' 
WHERE 
  key_id = 'e2a6ff97655392c11046cf33d4aef55afbe49107d63b1f57c4e08e21471929ae' 
  AND (
    token = 'Q4x0TObc4N/ohapFBmg6X3OUL8tq75w5eiPc0F7Setc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030