UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jPaSRUhrr2tlNtXvdkJzBATKhgIYbgOJ6yZcU4Zl8yk=' 
WHERE 
  key_id = '854e785326d427b9fa374804b579bf0d574721759646ec86eabf753f2581d455' 
  AND (
    token = 'jPaSRUhrr2tlNtXvdkJzBATKhgIYbgOJ6yZcU4Zl8yk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028