UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RyxRDpjjEatL7zxXKx+T2GJgzi0GQxSCdLWkcRozXHI=' 
WHERE 
  key_id = 'f0e9b79e75a3f7d1d6d6574fa081acad49b011a0587519081475f4c6729a3fad' 
  AND (
    token = 'RyxRDpjjEatL7zxXKx+T2GJgzi0GQxSCdLWkcRozXHI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023