UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xXvMl4KmD/NnKQTZQShBoqee3mVCc59CJxgN/JfNqIA=' 
WHERE 
  key_id = '581fdf18db777692ee098719c03a2aab1abb66821d50b01f3ee00e09c6a5069e' 
  AND (
    token = 'xXvMl4KmD/NnKQTZQShBoqee3mVCc59CJxgN/JfNqIA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00061