UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fvSuVrVWsYzFYb5moBMdGdzimYkyqj1jD3iamY3ZK1k=' 
WHERE 
  key_id = '1a7fdc77e9ec662aa3a21314270f1e312f6a71399b735b082ed22dcc480d7a06' 
  AND (
    token = 'fvSuVrVWsYzFYb5moBMdGdzimYkyqj1jD3iamY3ZK1k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024