UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'U3rqqw/BzQQLL//6IIHc4khPbqAKWjqLuJlIndfbx00=' 
WHERE 
  key_id = 'e48827d2365415e65d99230bc651a8b69c482bde34cedaa96dd2031a49093c7c' 
  AND (
    token = 'U3rqqw/BzQQLL//6IIHc4khPbqAKWjqLuJlIndfbx00=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042