UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bWEqeCLN9332Dsnk2i5/DWgJHAJ6X91XoKwxyo61rGI=' 
WHERE 
  key_id = '6640fc38a2011d04821ff47f144dfa85af30fe9a5626a07ce7b4ae677704923f' 
  AND (
    token = 'bWEqeCLN9332Dsnk2i5/DWgJHAJ6X91XoKwxyo61rGI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021