UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uqEPYZdgr3xkDGXgji4ARPiUlWJRZNR4ekUupeFu2Bg=' 
WHERE 
  key_id = '93d37e3683cae629501285c45924737625a416ce84048b03b62a20386d28c0ac' 
  AND (
    token = 'uqEPYZdgr3xkDGXgji4ARPiUlWJRZNR4ekUupeFu2Bg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016