UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9ToQMbxBFhWI5vIUJMg49g1sfURbwI7smJvjQRzCXGs=' 
WHERE 
  key_id = 'e29f4e0c5c297d49a08bd201c0d5db9ef2bf5272cdcabc52bb6a0e85c19f5960' 
  AND (
    token = '9ToQMbxBFhWI5vIUJMg49g1sfURbwI7smJvjQRzCXGs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024