UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/JO5YSDV/FRozmlnI5+c4P/0XQgLN9AN5Si5JZNdpH0=' 
WHERE 
  key_id = 'b5c1037f449044fe0407cd9f880d44c20a2a92cb0cfe205a67cb4606df65ad89' 
  AND (
    token = '/JO5YSDV/FRozmlnI5+c4P/0XQgLN9AN5Si5JZNdpH0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032