UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CGCJS12TJ/TGhM5DPZP8KUlg8dhB7KkcxKSc2xn6dEw=' 
WHERE 
  key_id = 'ce8cd27b682e12c23b4374805c442c4b32e1be0177470a46735331fe0b1500a7' 
  AND (
    token = 'CGCJS12TJ/TGhM5DPZP8KUlg8dhB7KkcxKSc2xn6dEw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036