UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'a1n0SSrMl35h+aOZFAB6RxbvMkEVQp1ojd75mLoSJEw=' 
WHERE 
  key_id = 'ac37b578bf7b9a79ee70bacfd66c9cd21f0f9fd44cb523250b60d6cf65142f93' 
  AND (
    token = 'a1n0SSrMl35h+aOZFAB6RxbvMkEVQp1ojd75mLoSJEw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034